/**
 * AboutWindow.java 2008-05-14
 * 
 * Linker is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */

package linker.gui;

import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

import javax.swing.JFrame;
import javax.swing.JLabel;

import linker.LocalVariablesManager;
import linker.account.ManageAccount;

/**
 * About window.Only used to show version information and project information.
 * 
 * @version 2008-05-19
 * @author Jianfeng tujf.cn@gmail.com
 * 
 */

public class AboutWindow extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * The AboutWindow's constructor.
	 * 
	 */
	public AboutWindow() {
		super(LocalVariablesManager.getLocalVariables("AboutWindow"));
		setName("AboutWindow");
		setIconImage(ManageAccount.getLogo());

		JLabel link = new JLabel("<html><body>Linker 0.9.6<br>"
				+ "<ul><li>Host <a href=code.google.com/p/lingker>"
				+ "code.google.com/p/lingker</a></li><li>Site "
				+ "<a href=http://www.imlinker.org>"
				+ "imlinker.org</a></li><li>Publisher "
				+ "<a href =http://www.weborn.org>weborn.org</li>"
				+ "</ul> <body></html>");
		getContentPane().add(link, BorderLayout.CENTER);

		link.setCursor(new Cursor(Cursor.HAND_CURSOR));

		link.addMouseListener(new MouseAdapter() {
			public void mouseClicked(final MouseEvent e) {
				try {
					Desktop.getDesktop().browse(
							new URI("http://code.google.com/p/lingker/"));
				} catch (IOException e1) {
					e1.printStackTrace();
				} catch (URISyntaxException e1) {
					e1.printStackTrace();
				}
			}
		});

		pack();
		setLocationRelativeTo(null);
		setVisible(true);
	}
}
